package com.rui.j2se.test.p1;

/**
 * Created by restmad on 15-5-3.
 */
public class UserInfo {
    private String userName;
    private String userPassword;
    private int age;
    private int gender;
    private String address;
    private String telephone;

    public UserInfo() {
    }

    public UserInfo(String userName, String userPassword, int age, int gender, String address, String telephone) {
        this.userName = userName;
        this.userPassword = userPassword;
        this.age = age;
        this.gender = gender;
        this.address = address;
        this.telephone = telephone;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getUserPassword() {
        return userPassword;
    }

    public void setUserPassword(String userPassword) {
        this.userPassword = userPassword;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public int getGender() {
        return gender;
    }

    public void setGender(int gender) {
        this.gender = gender;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getTelephone() {
        return telephone;
    }

    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }

    public static void main(String[] args) {
        UserInfo u1 = new UserInfo();
        u1.setUserName("marui");
        u1.setUserPassword("aaa");
        if(UserInfo.Login(u1)) {
            System.out.println("user1 can access to the system.");
        }
        UserInfo u2 = new UserInfo();
        u2.setUserName("marui");
        u2.setUserPassword("marui");
        if(UserInfo.Login(u2)) {
            System.out.println("user2 can access to the system.");
        }
    }

    public static boolean Login(UserInfo user) {
        if(user.getUserName().equals("marui") && user.getUserPassword().equals("marui")) {
            return true;
        }
        return false;
    }
}
